package com.dura.api.advice;

import com.dura.common.exception.ApiException;
import com.dura.api.util.R;
import com.dura.api.vo.ResultVO;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @version 1.0
 * @Author 振鹏
 * @Date 2025/3/15 22:14
 * @注释
 */
@RestControllerAdvice
public class ApiExceptionHandler {

    @ExceptionHandler(ApiException.class)
    public ResultVO apiException(ApiException ex){
        return R.error(ex);
    }
}
